package com.ycsj.goldmedalnewconcept.teacher.adapter;

import android.content.Context;
import android.widget.TextView;

import com.ycsj.common.base.CommonAdapter;
import com.ycsj.common.base.ViewHolder;
import com.ycsj.goldmedalnewconcept.R;

import java.util.List;

/**
 * 展示答案选项的适配器
 * Created by Administrator on 2019/2/21 0021.
 */
public class TkShowAnswerAdapter extends CommonAdapter<String> {

    //选项
    private String[] letters = {"A", "B", "C", "D", "E", "F", "G" ,"H"};

    public TkShowAnswerAdapter(Context context, List<String> datas, int layoutId) {
        super(context, datas, layoutId);
    }

    @Override
    public void convert(ViewHolder holder, String optionInfo) {
        //答案序号
        TextView tvIndex = holder.getView(R.id.tv_index);
        tvIndex.setText(letters[holder.getPosition()]+".");
        //答案内容
        TextView tvAnswer = holder.getView(R.id.tv_answer);
        tvAnswer.setText(optionInfo+"");

    }
}
